package net.csdn.business.common.domain.request;

import com.alibaba.fastjson2.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author chenji
 * @date 2022/6/29 11:47
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class NotifyTemplateDto implements Serializable {
    /**
     * 类型(1:邮件，2:短信)
     */
    @Range(min = 1, max = 2, message = "类型不合法")
    private Integer type;
    /**
     * 模板code
     */
    @NotNull(message = "模板code不能为空")
    private String code;
    /**
     * 所需参数
     * <code>
     * {"content":{"key":"$.content","keyName":"content"},"userImg":{"key":"$.userImg","keyName":"userImg"},"nickName":{"key":"$.nickName","keyName":"nickName"},"issueTitle":{"key":"$.issueTitle","keyName":"issueTitle"},"viewDetailUrl":{"key":"$.viewDetailUrl","keyName":"viewDetailUrl"},"issueSerialNumber":{"key":"$.issueSerialNumber","keyName":"issueSerialNumber"}}
     * </code>
     */
    private JSONObject params;

    private String createUid;

    private String updateUid;

    /**
     * 内容模板
     */
    @NotNull(message = "template不能为空")
    private String template;

    /**
     * 标题模板
     * <code>
     * 【#{[nickName]}】在 Issue 中@了你
     * </code>
     */
    private String subject;
}